import type { App } from 'vue';
import DictSelect from '@/components/business/DictSelect';
import { componentMap } from '@/components/core/schema-form/src/componentMap';

// 扩展schema form组件类型定义
declare module '@/components/core/schema-form/src/types/component' {
  interface ComponentMapType {
    DictSelect: typeof DictSelect;
  }
}

// 注册自定义全局组件
export function setupCustomComponents(app: App) {
  // 注册为全局组件
  app.component('DictSelect', DictSelect);
  
  // 同时添加到SchemaForm的组件映射中
  Object.assign(componentMap, {
    DictSelect,
  });
} 